      <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
          <ol class="breadcrumb">
            <li><a href="<?=site_url()?>/order/index">订单管理</a></li>
            <li class="active">选择分拣表</li>
          </ol>
          <div class="row">
            <div class="col-md-12">
              <form role="form" id="form" action="<?php echo site_url('order/exportNewsort')?>"  method="post">
              <?php foreach ($regions as $region):?>
              		<div>
              			<h4><?php echo $region['name'];?><input type="checkbox" name="Btype" class="class<?php echo $region['district'];?>" /></h4>
              		</div>
              		<div>
              		   <?php 
						foreach ($users as $item){
							if($region['district']==$item['district']){
					?>
					<input type="checkbox" name="user[]" class="class<?php echo $region['district'];?>" value="<?php echo $item['userid'];?>" /><?php echo $item['shopname'].'('.$item['early_time'].'-'.$item['late_time'].')';?>
					<?php 
							}
						} 
					?>
              		</div>
              <?php endforeach;?>		
              <div>
              	 <input type="hidden" name="date" value="<?php echo $date;?>" />
             	 <input type="submit" class="btn btn-primary" value="导出分拣表" />
              </div>
              </form>
            </div>
          </div>
        </div>
      </div>
<script>
	$(document).ready(function() {
		$("input[name='Btype']").click(function(){
			if(this.checked){
				$("input[class="+this["className"]+"]").each(function(){
    				$(this).prop("checked",true);
   				});
			}
			else{
				$("input[class="+this["className"]+"]").each(function(){
    				$(this).prop("checked",false);
   				});
  			}
  		});
	}); 
</script>